using System.Collections.Generic;
using System.Linq;
using Crawler.Domain;

namespace Crawler.Abot.Configurations
{
	class ConfiguratorProvider : IConfiguratorProvider
	{
		private readonly IEnumerable<IConfigurator> _configurators;

		public ConfiguratorProvider(IEnumerable<IConfigurator> configurators)
		{
			_configurators = configurators;
		}

		public IConfigurator Get(TorrentSource source)
		{
			return _configurators.Single(x => x.ForType == source);
		}
	}
}